#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll sq(ll x) {
	ll l = 1, r = 1000000000;
	while (l < r) {
		ll mid = (l + r) / 2;
		if (mid * mid >= x)
			r = mid;
		else
			l = mid + 1;
	}
	return l;
}
int main() {
	freopen("tree.in", "r", stdin);
	freopen("tree.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	ll t;
	cin >> t;
	while (t--) {
		ll x;
		cin >> x;
		if (x == 0) {
			cout << 2 << '\n';
			continue;
		}
		ll r = 2 * sq(x), s = sq(x);
		if (x % 2 == 1 || ((2 * s - 1) * (2 * s - 1) <= 4 * x && s * s != x) || (s * s == x))r++;
		cout << r << '\n';
	}
	return 0;
}
